package de.wittekind.bundesjugendspiele.server.impl.rmi;

import java.io.IOException;
import java.rmi.server.UnicastRemoteObject;
import java.util.GregorianCalendar;

import de.wittekind.bundesjugendspiele.server.interfaces.Discipline;
import de.wittekind.bundesjugendspiele.server.interfaces.Schueler;
import de.wittekind.bundesjugendspiele.server.interfaces.Try;

/**
 * @author Claudius Ellsel
 * 
 * @version 07.05.2013
 */

public class RMISchueler extends UnicastRemoteObject implements Schueler {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1177771009198559477L;
	private Schueler schueler;

	public RMISchueler(Schueler schueler) throws IOException {
		this.schueler = schueler;
	}

	@Override
	public int getID() throws IOException {
		return schueler.getID();
	}

	@Override
	public String getLastName() throws IOException {
		return schueler.getLastName();
	}

	@Override
	public int hashCode() {
		return schueler.hashCode();
	}

	@Override
	public String getFirstName() throws IOException {
		return schueler.getFirstName();
	}

	@Override
	public GregorianCalendar getBirthday() throws IOException {
		return schueler.getBirthday();
	}

	@Override
	public int getPoints() throws IOException {
		return schueler.getPoints();
	}

	@Override
	public int getTry() throws IOException {
		return schueler.getTry();
	}

	@Override
	public Try[] getTries() throws IOException {
		Try[] tries = schueler.getTries();
		for (int i = 0; i < tries.length; i++) {
			tries[i] = new RMITry(tries[i]);
		}
		return tries;
	}

	@Override
	public boolean equals(Object obj) {
		return schueler.equals(obj);
	}

	@Override
	public int getCurrentDiscipline() throws IOException {
		return schueler.getCurrentDiscipline();
	}

	@Override
	public Gender getGender() throws IOException {
		return schueler.getGender();
	}

	@Override
	public String getForm() throws IOException {
		return schueler.getForm();
	}

	@Override
	public void setTry(int nTry) throws IOException {
		schueler.setTry(nTry);
	}

	@Override
	public void setTries(Try[] tries) throws IOException {
		schueler.setTries(tries);
	}

	@Override
	public Try createNewTry() throws IOException {
		return new RMITry(schueler.createNewTry());
	}

	@Override
	public void setFirstName(String nFirstName) throws IOException {
		schueler.setFirstName(nFirstName);
	}

	@Override
	public void setBirthday(GregorianCalendar nDate) throws IOException {
		schueler.setBirthday(nDate);
	}

	@Override
	public void setGender(Gender nGender) throws IOException {
		schueler.setGender(nGender);
	}

	@Override
	public void setForm(String nClass) throws IOException {
		schueler.setForm(nClass);
	}

	@Override
	public void setDiscipline(int id, Discipline d) throws IOException {
		schueler.setDiscipline(id, d);
	}

	@Override
	public void setLastName(String string) throws IOException {
		schueler.setLastName(string);
	}

	@Override
	public String toString() {
		return schueler.toString();
	}

	@Override
	public int getNote() throws IOException {
		return schueler.getNote();
	}

	@Override
	public boolean hasEhrenurkunde() throws IOException {
		return schueler.hasEhrenurkunde();
	}

	@Override
	public boolean hasSiegerurkunde() throws IOException {
		return schueler.hasSiegerurkunde();
	}

	@Override
	public void setActive(boolean b) throws IOException {
		schueler.setActive(b);
	}
}
